import { ElementEntity } from './ElementEntity';
import { COLOR, formarColor, CreatePosition } from '../Config'
import Label from './Label';


class CircleEntity extends ElementEntity {
    constructor(options = {}) {
        super(options.id, options, options.onClick, options.onRightClick);
        this.EntityTypeName = 'ElementEntity'
        this.color = formarColor(options.color) || COLOR.MarkViewColor;
        this.lineWidth = options.lineWidth || 0;
        this.lineColor = formarColor(options.lineColor) || COLOR.LOCATIONCOVER;
        this.Point = CreatePosition(options.point);
        this.radius = options.radius;
        this.Entity.position = this.Point;
        this.height = options.height || 1000;
        this.Entity.ellipse = {
            semiMinorAxis: this.radius,
            semiMajorAxis: this.radius,
            material: this.color,
            height: this.height,
            outline: !!this.lineWidth,
            outlineColor: this.lineColor,
            outlineWidth: this.lineWidth,
        }
        if (options.label) {
            this.Label = new Label(this.Entity, options.label, {});
        }
    }
}

export default CircleEntity;